package xin.mashibo.genvictobutest.vo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author MaShibo
 *         on 2018/3/26
 */
public class CardMac1About {

    private String cardNo;

    private String incMny;

    private String random;

    private String balance;

    private String mac1;

    private String onlineSn;


    public CardMac1About(String infos) {
        if (infos == null || "".equals(infos.trim())) {
            throw new IllegalArgumentException("MAC1相关信息组合不能为空");
        }
        Map<String, String> infoMap = new HashMap<>(6);
        for (String entry : infos.split("&")) {
            String[] pairs = entry.split("=");
            String one = pairs[0];
            String two = pairs[1];
            infoMap.put(one, two);
        }
        cardNo = infoMap.get("a_cid");
        incMny = infoMap.get("a_pt");
        random = infoMap.get("a_rnd");
        balance = infoMap.get("a_cbb");
        mac1 = infoMap.get("a_m1");
        onlineSn = infoMap.get("a_on");
    }

    public String getCardNo() {
        return cardNo;
    }

    public String getIncMny() {
        return incMny;
    }

    public String getRandom() {
        return random;
    }

    public String getBalance() {
        return balance;
    }

    public String getMac1() {
        return mac1;
    }

    public String getOnlineSn() {
        return onlineSn;
    }

}
